/**
 ----------------------
 1.当前文件用于编辑表单
 2.提供表单相关属性
 3. @param xxxFormConfig.current 指向当前选中的数据
 ----------------------
 */
import type {SystemConfig} from '@/api/modules/system/config/types';
import type {Rule} from 'ant-design-vue/es/form/interface';
import {useAxForm} from '@/utils/common/hooks';

const configFormObj: SystemConfig = {
        configId: 0 ,
        configName: "" ,
        configKey: "" ,
        configValue: "" ,
        configType: "" ,
        createBy: "" ,
        createTime: null ,
        updateBy: "" ,
        updateTime: null ,
        remark: "" ,
};

// 表格校验
export const configRules: Record<string, Rule[]> = {
    configName: [{required: false , trigger: 'change'}],
    configKey: [{required: false , trigger: 'change'}],
    configValue: [{required: false , trigger: 'change'}],
    configType: [{required: false , trigger: 'change'}],
    remark: [{required: false , trigger: 'change'}],
};
export const configFormConfig = useAxForm<SystemConfig>(configFormObj);
export const configFormRef = ref()